<template>
	<view class="padding" v-if="pageShow">
		<view class="padding ffffff border_2 flexleft margin_bottom5">
			<view class="">
				<view class="color_san text_c">
					物流状态：
					<text style="color: rgba(0, 177, 82, 1);">{{dataAll.data[0].status}}</text>
				</view>
				<view class="color_san text_c margin_top2">
					物流公司：{{dataAll.express_name}}
				</view>
				<view class="color_san text_c margin_top2">
					快递单号：{{dataAll.express_no}}
				</view>
			</view>
		</view>
		<view class="paddinglr">
			<u-steps direction="column" dot inactiveColor="rgba(217, 217, 217, 1)" activeColor="rgba(243, 39, 28, 1)" :current = "dataAll.data.length">
				<u-steps-item :title="item.content" :desc="item.date+' '+item.time" v-for="(item,index) in dataAll.data" :key="index"></u-steps-item>
			</u-steps>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid:"",
				type:1,//1商家端商品订单,2商家端商品退货订单,3用户端商品订单
				dataAll:{},
				pageShow:false,
			}
		},
		onLoad(options) {
			let _this = this
			_this.listid = options.id
			_this.type = options.type
			this.getDetail()
		},
		methods:{
			getDetail(){
				let url = ""
				let data = {}
				if(this.type==1){//商家端商品订单
					url = "/api/shop.goods_order/express"
					data = {
						order_id:this.listid
					}
				}
				if(this.type==2){//商家端商品退货订单
					url = "/api/shop.goods_refund/express"
					data = {
						order_refund_id:this.listid
					}
				}
				if(this.type==3){//用户端商品订单
					url = "/api/goods_order/express"
					data = {
						order_id:this.listid
					}
				}
				httpRequest.request(url, 'POST', data, false, false, true).then(res => {
					if(res.code==1){
						this.list = res.data.data
						this.dataAll = res.data
						this.pageShow = true
					}else{
						httpRequest.toast(res.msg)
						setTimeout(()=>{
							uni.navigateBack(1)
						},1000)
					}
				}).catch(err=>{
					httpRequest.toast(err.msg)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.imgBox {
		width: 134rpx;
		height: 134rpx;
		border-radius: 14rpx 14rpx 14rpx 14rpx;
		overflow: hidden;

		image {
			width: 100%;
			height: 100%;
		}
	}
	::v-deep.u-steps-item{
		margin-bottom: 80rpx !important;
	}
	::v-deep.u-steps-item__line{
		height: 225rpx !important;
	}
	.slot-icon {
		width: 50rpx;
		height: 50rpx;
		background-image: url('/static/image/mine/transport.png');
		background-repeat: no-repeat;
		background-size: 100% 100%;
	}
	.slot-icon-final{
		width: 50rpx;
		height: 50rpx;
		background-image: url('/static/image/mine/complete.png');
		background-repeat: no-repeat;
		background-size: 100% 100%;
	}
</style>